Handling PHP's "getaddrinfo failed" errors in a Linux server when using Vagrant
A fresh linux OS running inside a vagrant box will not resolve domain names itself.
Using PHP, you'll get some "PHP php_network_getaddresses: getaddrinfo failed: No such host is known</code>" errors.
To fix it, just change your /etc/network/interfaces conf:
auto eth0
iface eth0 inet dhcp
dns-search google.com
dns-nameservers dnsserverip
Then restart the network manager :
sudo service network restart
You'll be disconnected from your previous vagrant ssh session, but that's fine, just re-log, and that's it.
Written by Ronan Guilloux
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#